Integrand size = 21, antiderivative size = 62 \[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {(4 a-3 b) b \text {arctanh}(\sin (c+d x))}{2 d}+\frac {(a-b)^2 \sin (c+d x)}{d}+\frac {b^2 \sec (c+d x) \tan (c+d x)}{2 d} \]
Time = 0.43 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.06 \[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {(4 a-3 b) b \text {arctanh}(\sin (c+d x))+\left (a^2-2 a b+2 b^2+(a-b)^2 \cos (2 (c+d x))\right ) \sec (c+d x) \tan (c+d x)}{2 d} \]
((4*a - 3*b)*b*ArcTanh[Sin[c + d*x]] + (a^2 - 2*a*b + 2*b^2 + (a - b)^2*Co s[2*(c + d*x)])*Sec[c + d*x]*Tan[c + d*x])/(2*d)
Time = 0.28 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.05, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4159, 300, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \tan (c+d x)^2\right )^2}{\sec (c+d x)}dx\) |
\(\Big \downarrow \) 4159 |
\(\displaystyle \frac {\int \frac {\left (a-(a-b) \sin ^2(c+d x)\right )^2}{\left (1-\sin ^2(c+d x)\right )^2}d\sin (c+d x)}{d}\) |
\(\Big \downarrow \) 300 |
\(\displaystyle \frac {\int \left ((a-b)^2+\frac {(2 a-b) b-2 (a-b) b \sin ^2(c+d x)}{\left (1-\sin ^2(c+d x)\right )^2}\right )d\sin (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {1}{2} b (4 a-3 b) \text {arctanh}(\sin (c+d x))+(a-b)^2 \sin (c+d x)+\frac {b^2 \sin (c+d x)}{2 \left (1-\sin ^2(c+d x)\right )}}{d}\) |
(((4*a - 3*b)*b*ArcTanh[Sin[c + d*x]])/2 + (a - b)^2*Sin[c + d*x] + (b^2*S in[c + d*x])/(2*(1 - Sin[c + d*x]^2)))/d
3.5.39.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_ ))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2 *x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f} , x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
Time = 0.79 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.61
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+2 a b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a^{2} \sin \left (d x +c \right )}{d}\) | \(100\) |
default | \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+2 a b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+a^{2} \sin \left (d x +c \right )}{d}\) | \(100\) |
risch | \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 d}+\frac {i {\mathrm e}^{i \left (d x +c \right )} a b}{d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} b^{2}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} a b}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 d}-\frac {i b^{2} \left ({\mathrm e}^{3 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a b}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{2 d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a b}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{2 d}\) | \(233\) |
1/d*(b^2*(1/2*sin(d*x+c)^5/cos(d*x+c)^2+1/2*sin(d*x+c)^3+3/2*sin(d*x+c)-3/ 2*ln(sec(d*x+c)+tan(d*x+c)))+2*a*b*(-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c))) +a^2*sin(d*x+c))
Time = 0.27 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.71 \[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {{\left (4 \, a b - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (4 \, a b - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
1/4*((4*a*b - 3*b^2)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (4*a*b - 3*b^2 )*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(2*(a^2 - 2*a*b + b^2)*cos(d*x + c)^2 + b^2)*sin(d*x + c))/(d*cos(d*x + c)^2)
\[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos {\left (c + d x \right )}\, dx \]
Time = 0.24 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.69 \[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=-\frac {b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right ) - 4 \, \sin \left (d x + c\right )\right )} - 4 \, a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - 4 \, a^{2} \sin \left (d x + c\right )}{4 \, d} \]
-1/4*(b^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + 3*log(sin(d*x + c) + 1) - 3*log(sin(d*x + c) - 1) - 4*sin(d*x + c)) - 4*a*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)) - 4*a^2*sin(d*x + c))/d
Time = 0.67 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.68 \[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {4 \, a^{2} \sin \left (d x + c\right ) - 8 \, a b \sin \left (d x + c\right ) + 4 \, b^{2} \sin \left (d x + c\right ) + {\left (4 \, a b - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (4 \, a b - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, b^{2} \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \]
1/4*(4*a^2*sin(d*x + c) - 8*a*b*sin(d*x + c) + 4*b^2*sin(d*x + c) + (4*a*b - 3*b^2)*log(abs(sin(d*x + c) + 1)) - (4*a*b - 3*b^2)*log(abs(sin(d*x + c ) - 1)) - 2*b^2*sin(d*x + c)/(sin(d*x + c)^2 - 1))/d
Time = 14.34 (sec) , antiderivative size = 148, normalized size of antiderivative = 2.39 \[ \int \cos (c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (4\,a-3\,b\right )}{d}-\frac {\left (2\,a^2-4\,a\,b+3\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-4\,a^2+8\,a\,b-2\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^2-4\,a\,b+3\,b^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]